<?php

/**
 * author : Tran Minh Toan
 */
class Application_Form_Warrantydt extends Zend_Form{
    
    public function init(){
        $this->setName('Warrantydt');
        
        $warrantydt_id = new Zend_Form_Element_Hidden('warrantydt_id');
        $warrantydt_date_created = new Zend_Form_Element_Hidden('warrantydt_date_created');
        
        $warranty_id = new Zend_Form_Element_Text('warranty_id');
            $warranty_id->setLabel('ID phiếu bảo hành : ')
                    ->setRequired(TRUE)
                    ->addFilters(array('StripTags', 'StringTrim', 'Int'))
                    ->addValidator('NotEmpty');
        $warranty_reason = new Zend_Form_Element_TextArea('warranty_reason');
            $warranty_reason->setLabel('Lý do bảo hành : ')
                    ->setRequired(true)
                    ->addValidator('NotEmpty')
                    ->setAttribs(array('cols'=>30, 'rows'=>30));
        $returnedDate = new Zend_Form_Element_Text('returnedDate');
            $returnedDate->setLabel('Ngày trả hàng : ')
                    ->addValidator('date', 'YYYY-mm-dd')
                    ->addValidator('NotEmpty');
        $description = new Zend_Form_Element_TextArea('description');
            $description->setLabel('Ghi chú : ')
                    ->setRequired(true)
                    ->addFilters(array('StripTags', 'StringTrim'));
            
        $btn_submit = new Zend_Form_Element_Submit('submit');
            $btn_submit->setAttrib('id', 'submit');
            $btn_submit->setlabel('Đồng ý');

        $btn_cancel = new Zend_Form_Element_Submit('cancel');
            $btn_cancel->setAttrib('id', 'cancel');
            $btn_cancel->setLabel('Hủy bỏ');
        
    
        $this->addElements(array($warrantydt_id, $warranty_id, $warrantydt_date_created, $warranty_reason,  
                                $returnedDate, $description, $btn_submit, $btn_cancel));
    }
}

?>
